package IOStream.SerializationStream;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;

/**
 * ClassName:Dome002
 * Package:IOStream.SerializationStream
 * Description:
 *
 * @Author:ZhangXin
 * @Create2023/3/3-19:44
 * @Version:v1.0
 */
public class ObjectInputStream002 {
    /**反序列化流/对象操作输入流
     *
     * public ObjectInputStream(InputStream out) 把基本流变成高级流
     * public Object readObject() 把序列化到本地文件中的对象,读取到程序中来*/
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        //创建反序列化流的对象
        ObjectInputStream ois = new ObjectInputStream(new FileInputStream("E:\\aaa\\a.txt"));
        //读取数据
        Object o = ois.readObject();
        //打印对象
        System.out.println(o);
        //释放资源
        ois.close();
    }
}
